package text;

import java.util.Scanner;

public class StingReverse {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串：");
        String s = sc.nextLine();
        String result = reverse(s);
        System.out.println("结果为："+result);
    }
    public static String reverse(String str){
        StringBuilder SB = new StringBuilder(str);
        String s = SB.reverse().toString();
        return s;
    }

}
